Starting
with version 3.2, iOS includes some compelling new graphics
capabilities. Besides the larger screen in the iPad, the software has
also been updated with some new features that will help developers make
their apps even better.
One bit of
graphics functionality that apparently hasn't changed is OpenGL. The
iPad uses the same graphics hardware, and the same OpenGL ES 2.0, that
the iPhone 3GS uses. Therefore, any OpenGL code you've written for
iPhone in the past should work with little or no changes on the iPad
(for that matter, any Quartz/CoreGraphics drawing code should also be
functionally equivalent).
1. Bezier Paths
One great new feature of iOS 3.2 is the inclusion of the UIBezierPath
class, which gives you the ability to draw paths of arbitrary
complexity. Anyone who has used a vector-drawing program such as Adobe
Illustrator is probably familiar with the path tool, which lets you
define a curve by clicking on points. You define a start and end point
for the curve, along with two control points, giving you a smooth curve
from one point to the other. The curve you create in this way is
actually several Bézier paths linked together. However, a Bézier path
can also define straight lines, rectangles, and basically any other 2D
shape you have in mind. Figure 4-1 shows some examples of paths drawn using UIBezierPath.